import re

# 缓存 ,regex
# 可反复使用
# 处理速度更快
string1 = 'abcb'
pattern = 'B'
regex = re.compile(pattern,flags = re.I)
res = regex.findall(string1)
print(res)